import pandas as pd
import cv2


class ImageList:
    def __init__(self, path, w, h, firstCount, endCount):
        self.path = path
        self.w = w
        self.h = h
        self.start = firstCount
        self.end = endCount


lists = [ImageList('./have_mask/', 20, 20, 1000, 1605), 
            ImageList('./no_mask/', 80, 80, 10000, 11789)]
for list in lists:
    for n in range(list.start, list.end + 1):
        path = list.path + str(n) + '.jpg'
        img = cv2.imread(path)
        img = cv2.resize(img, (list.w, list.h))
        cv2.imwrite(path, img)
        n += 1
    